package com.vogue.supplymall.entmanagement.domain.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Lang;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import com.vogue.ssm.database.util.SqlLangDriver;
import com.vogue.supplymall.entmanagement.domain.model.LicenceScopeOfBusiness;

@Mapper
public interface LicenceScopeOfBusinessMapper extends BaseMapper<LicenceScopeOfBusiness, Long> {

	/**
	 * 返回所有的经营范围，连同经营范围对应哪些执照也一起返回
	 * 
	 * @return
	 */
	@Select("select ls.id sodid, ls.name sodname, lt.id typeid, lt.name typename from rel_licencesob_licencetype rll , licence_scopeofbusiness ls, licence_type lt "
			+ "where rll.sobid = ls.id and rll.typeid = lt.id and ls.disabledflag = 0 and lt.disabledflag = 0 and rll.disabledflag = 0 "
			+ "order by ls.seqnum,lt.seqnum")
	@Lang(SqlLangDriver.class)
	public List<Map<String, Object>> allScopeOfBusiness();
}
